<?php
namespace Enkuso\PropertyBundle\DataFixtures\ORM;

use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Nimo\Bundle\BookstoreApiBundle\Entity\Book\Tag;

class LoadTagData extends AbstractFixture implements OrderedFixtureInterface
{
    /**
     * {@inheritDoc}
     */
    public function load(ObjectManager $manager)
    {
        $tag= new Tag();
        $tag->setTag('цус сорогч');

        $saga= new Tag();
        $saga->setTag('saga');

        $manager->persist($tag);
        $manager->persist($saga);
        $manager->flush();

        $this->addReference('book-tag-vampire', $tag);
        $this->addReference('book-tag-saga', $saga);
    }

    /**
     * {@inheritDoc}
     */
    public function getOrder()
    {
        return 80; // the order in which fixtures will be loaded
    }
}
